package org.xinjiang.data.migration.xinjiang.contorller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xinjiang.data.migration.common.response.Param;
import org.xinjiang.data.migration.common.response.Result;
import org.xinjiang.data.migration.xinjiang.dto.req.XjDcpgQueryDTO;
import org.xinjiang.data.migration.xinjiang.dto.res.XjSubDcpgResultDTO;
import org.xinjiang.data.migration.xinjiang.service.IXjDcpgService;

/**
 * @Description: 新疆调查评估
 */
@Api(tags = "新疆调查评估")
@RestController
@RequestMapping("/xinjiang/dcpg")
@Slf4j
public class XjDcpgController {
    @Autowired
    private IXjDcpgService xjDcpgService;

    /**
     * 手工sql实现分页列表查询
     *
     * @return
     */
    @Operation(summary = "新疆矫正对象-手工sql实现分页列表查询")
    @PostMapping(value = "/findPageList")
    public Result<IPage<XjSubDcpgResultDTO>> findPageList(Param pageable, @Validated @RequestBody XjDcpgQueryDTO dto) {
        IPage<XjSubDcpgResultDTO> pageList = xjDcpgService.findPageList(pageable, dto);
        return Result.ok(pageList);
    }
}
